#ifndef __CLOCK_H
#define __CLOCK_H

#include "stdint.h"

#define SYSTEM_CONFIG_PULSE_EN	0

#define NVIC_PRIORITYGROUP_0         0x00000007U /*!< 0 bits for pre-emption priority 4 bits for subpriority */
#define NVIC_PRIORITYGROUP_1         0x00000006U /*!< 1 bits for pre-emption priority 3 bits for subpriority */
#define NVIC_PRIORITYGROUP_2         0x00000005U /*!< 2 bits for pre-emption priority 2 bits for subpriority */
#define NVIC_PRIORITYGROUP_3         0x00000004U /*!< 3 bits for pre-emption priority 1 bits for subpriority */
#define NVIC_PRIORITYGROUP_4         0x00000003U /*!< 4 bits for pre-emption priority 0 bits for subpriority */

#define SYSTEM_CLK_HIRC_NOT_STABLE (0x01 << 0)
#define SYSTEM_CLK_HXT_NOT_STABLE  (0x01 << 1)
#define SYSTEM_CLK_LXT_NOT_STABLE  (0x01 << 2)

uint8_t SystemClockConfig(void);
void SystemSetInterruptGroup(uint32_t PriorityGroup);

#if SYSTEM_CONFIG_PULSE_EN
void SystemPulseInit(void);
void SystemPulseGen(uint32_t nop);
#endif

#endif
